//
//  BaseViewController.h
//  lightSpot
//
//  Created by lightSpot on 2022.
//  Copyright © 2022 lightSpot. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface BaseViewController : UIViewController

@property (nonatomic,assign) NSInteger requestStates;//请求状态 0.未请求 1.请求中 2.请求完成
@property (nonatomic,strong) UIView *navigationBar;
@property (strong, nonatomic) UIView *leftItem;
@property (strong, nonatomic) UIView *titleView;
@property (strong, nonatomic) UIView *rightItem;
@property(nonatomic,assign) NSInteger pageIndex;

//成功刷新界面
- (void)subscriptionSuccessfullyRefreshed;

- (void)backAction:(UIButton *)sender;

//显示提示界面
- (void)showProgressHUD:(NSString *)title;

- (void)setNavigationItemTitleViewWithWhiteTitle:(NSString *)title;

#pragma mark - 高度
//navigationBar高度
- (float)navigationBarHeight;
//状态栏高度
- (float)statusBarHeight;
//底部安全距离
- (float)bottomBarHeight;

- (BOOL)isIphoneX;

#pragma mark 界面切换

//订阅页
- (void)gotoSubscribeViewController;
- (void)gotoBaseWebViewController:(NSString *)title url:(NSString *)url;

//不需要传参数的push 只需告诉类名字符串
- (void)pushViewControllerWithName:(id)classOrName;
//回到当前模块导航下的某一个页面
- (void)returnViewControllerWithName:(id)classOrName;

#pragma mark 左边按钮定制

/**
 *  自定义左边按钮
 */
- (void)setLeftItemWithIcon:(UIImage *)icon selector:(SEL)selector;
- (UIView *)ittemLeftItemWithIcon:(UIImage *)icon selector:(SEL)selector;
- (void)setLeftItemWithTitle:(NSString *)title selector:(SEL)selector;
- (UIView *)ittemLeftItemWithTitle:(NSString *)title selector:(SEL)selector;

#pragma mark 右边按钮定制

/**
 *  通过文字设置右侧导航按钮
 *
 *  @param title    文字
 *  @param selector 事件
 */
- (void)setRightItemWithTitle:(NSString *)title selector:(SEL)selector;
- (UIView *)ittemRightItemWithTitle:(NSString *)title selector:(SEL)selector;

/**
 *  通过ico定制右侧按钮
 *
 *  @param icon     图标
 *  @param selector 事件
 */
- (void)setRightItemWithIcon:(UIImage *)icon selector:(SEL)selector;
- (UIView *)ittemRightItemWithIcon:(UIImage *)icon selector:(SEL)selector;

#pragma mark titleView定制

//设置纯文字titleVIew
- (void)setNavigationItemTitleViewWithTitle:(NSString *)title;

@end
